<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>合众人寿公益平台客户管理系统</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<SCRIPT type="text/javascript">
	      var GB_ROOT_DIR = "<%=request.getContextPath()%>/html/skin/";
        </SCRIPT>	
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<link href="<%= request.getContextPath() %>/html/css/Main.css"
			rel="stylesheet" type="text/css" />
		<link href="<%=request.getContextPath()%>/html/css/gb_styles.css"
			rel="stylesheet" type="text/css"/>
		<link href="<%= request.getContextPath() %>/html/css/tree.css"
			rel="stylesheet" type="text/css" />
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/AJS.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/AJS_fx.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/gb_scripts.js"></script>
        <script type="text/javascript"
			src="<%= request.getContextPath() %>/html/js/PopupCalendar.js"></script>
		<script type="text/javascript"
			src="<%= request.getContextPath() %>/html/js/prototype.js"></script>
		<script type="text/javascript"
			src="<%= request.getContextPath() %>/html/js/buffalo.js"></script>
		<script type="text/javascript"
			src="<%= request.getContextPath() %>/html/js/pims.js"></script>
		<script type="text/javascript"
			src="<%= request.getContextPath() %>/html/js/xtree.js"></script>
		<script type="text/javascript"
			src="<%= request.getContextPath() %>/html/js/xloadtree.js"></script>
			
			<style>
body,ul,ol,dl,dd,p,h1,h2,h3,h4,h5,h6,form,input,textarea,select,td,th{margin:0;padding:0; font-family:"宋体",Arial, Helvetica, sans-serif;}
li{ list-style:none;}
.clear{ zoom:1;}
.clear:after{content:""; display:block; clear:both;}
</style>	
		
		<script type="text/javascript">
		  function save(){
		  if(document.getElementById("title").value ==''){
		     alert("请输入标题");
		     return false;
		  }
		   var fileName = document.getElementById("documentFile").value;
		   if(fileName ==null || fileName.length == 0){
		   		alert("请输入上传文件");
		   		return false;
		   }else{
		   		document.getElementById("fileName").value = document.getElementById("documentFile").value;
		   }
		   
		   if(document.getElementById("fileDesc").value== ''){
		   		alert("请输入文档说明");
		   		return false;
		   }
		   return true;
		  }
		  
		  function selunit(){
		    GB_showCenter("上传文档","<%=request.getContextPath()%>/jsp/document/impDataInfor.jsp",300,300);
	      }
	      
	       function refuseImp(){
		    GB_showCenter("上传文档","<%=request.getContextPath()%>/jsp/document/refuseImp.jsp",300,300);
	      }
		</script>
	</head>
    
    <c:if test="${error eq 1}">
	<body onload="selunit()">
	</c:if>
	 <c:if test="${error eq 2}">
	<body onload="refuseImp()">
	</c:if>
	<body>
		<div class="container">
			<div class="wrap clear">
				<div class="sub_wp_right">
					<div class="rt_tt">
						<h3 class="tittle">
							上传文档
						</h3>
					</div>
					<div class="ct">
						<div class="tiaojian">
							<form
								action="<%=request.getContextPath()%>/document/impDocument.do"
								method="post" onsubmit="return save()"
								enctype="multipart/form-data" name="impForm">
							 <div class="add">
								<table>
									<tr>
										<td align="right">
											<span>文档标题<font color="red">(*)</font>：</span>
										</td>
										<td class="t2">
											<input type="text" name="document.title" id="title" style="width:430px;"/>
										</td>
										<td>&nbsp;</td>
									</tr>
									<tr>
										<td align="right">
											<span>上传文档<font color="red">(*)</font>：</span>
										</td>
										<td class="t2">
											<input type="file" name="documentFile" id="documentFile" style="width:430px;" maxlength="100485760"/>
										</td>
										<td><font size="2px" color="#ff0000">允许上传最大文件10M</font></td>
									</tr>
									<tr>
										<td align="right">
											<span>文档说明<font color="red">(*)</font>：</span>
										</td>
										<td class="t2">
											<textarea rows="10" cols="59" name="document.fileDesc" id="fileDesc"></textarea>
										</td>
										<td>&nbsp;</td>
									</tr>
									<tr>
										<td colspan="3">
										<div class="btn">
											<input type="submit" name="imp" value="上传" />
									<input type="button" value="返回"
										onclick="location=('<%=request.getContextPath()%>/document/showDocuments.do')" />
										</div>
										</td>
									</tr>
								</table>
								</div>
								<input type="hidden" name="fileName" id="fileName" />
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>

	</body>
</html>
